import { hyRequest2 } from "..";

export function api1() {
  return hyRequest2
    .request({
      url: "/entire/list",
      params: {
        offset: 0,
        size: 20,
      },
    })
    .then((res) => {
      console.log(res);
    });
}

export function api2() {
  setTimeout(() => {
    hyRequest2
      .request({
        url: "/home/highscore",
        interceptors: {
          requestInterceptors: (config) => {
            console.log("/home/highscore请求成功的拦截");
            return config;
          },
          responseInterceptors: (response) => {
            console.log("/home/highscore响应成功的拦截");
            return response;
          },
        },
      })
      .then((res) => {
        console.log("/home/highscore", res);
      });
  }, 5000);
}

/* hyRequest2
  .request({
    url: "/entire/list",
    params: {
      offset: 0,
      size: 20,
    },
  })
  .then((res) => {
    console.log(res, "测试");
  }); */

/* new Promise<string>((resolve, reject) => {
  resolve("哈哈哈");
}).then((res) => {
  console.log(res);
}); */
